home *** CD-ROM | disk | FTP | other *** search
/ NeXT Education Software Sampler 1992 Fall / NeXT Education Software Sampler 1992 Fall.iso / Programming / c-runtime / include / RCS / objc-proto.h,v < prev    next >
Encoding:
Text File  |  1992-04-13  |  20.6 KB  |  936 lines

  1. head    0.13;
  2. access;
  3. symbols;
  4. locks
  5.     dennisg:0.13; strict;
  6. comment    @ * @;
  7.  
  8.  
  9. 0.13
  10. date    92.04.13.11.40.53;    author dennisg;    state Exp;
  11. branches;
  12. next    0.12;
  13.  
  14. 0.12
  15. date    92.01.03.02.57.08;    author dennisg;    state Exp;
  16. branches;
  17. next    0.11;
  18.  
  19. 0.11
  20. date    91.12.10.12.03.22;    author dennisg;    state Exp;
  21. branches;
  22. next    0.10;
  23.  
  24. 0.10
  25. date    91.12.07.00.57.20;    author dennisg;    state Exp;
  26. branches;
  27. next    0.9;
  28.  
  29. 0.9
  30. date    91.12.06.00.36.24;    author dennisg;    state Exp;
  31. branches;
  32. next    0.8;
  33.  
  34. 0.8
  35. date    91.12.01.01.29.29;    author dennisg;    state Exp;
  36. branches;
  37. next    0.7;
  38.  
  39. 0.7
  40. date    91.11.29.22.00.10;    author dennisg;    state Exp;
  41. branches;
  42. next    0.6;
  43.  
  44. 0.6
  45. date    91.11.29.20.02.01;    author dennisg;    state Exp;
  46. branches;
  47. next    0.5;
  48.  
  49. 0.5
  50. date    91.11.29.13.32.16;    author dennisg;    state Exp;
  51. branches;
  52. next    0.4;
  53.  
  54. 0.4
  55. date    91.11.29.00.24.14;    author dennisg;    state Exp;
  56. branches;
  57. next    0.3;
  58.  
  59. 0.3
  60. date    91.11.16.16.26.02;    author dennisg;    state Exp;
  61. branches;
  62. next    0.2;
  63.  
  64. 0.2
  65. date    91.11.07.22.31.42;    author dennisg;    state Exp;
  66. branches;
  67. next    0.1;
  68.  
  69. 0.1
  70. date    91.10.24.00.19.24;    author dennisg;    state Exp;
  71. branches;
  72. next    ;
  73.  
  74.  
  75. desc
  76. @This file contains function prototypes of the Objective-C
  77. run-time system available to users.
  78. @
  79.  
  80.  
  81. 0.13
  82. log
  83. @Check in after array version of run-time works.
  84. Expect more changes as hash version and other changes are made.
  85. @
  86. text
  87. @/* -*-c-*-
  88.  * This file contains prototype declarations of functions
  89.  *  provided by the run-time system.
  90.  *
  91.  * Copyright (C) 1991 Threaded Technologies Inc.
  92.  * 
  93.  * This program is free software; you can redistribute it and/or modify
  94.  * it under the terms of the GNU General Public License as published
  95.  * by the Free Software Foundation; either version 1, or any later version.
  96.  * 
  97.  * This program is distributed in the hope that it will be useful,
  98.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  99.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  100.  * General Public License for more details.
  101.  * 
  102.  * You should receive a copy of the GNU General Public License 
  103.  * along with this program; if not, write to the Free Software
  104.  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  105.  * 
  106.   $Header: /usr/user/dennis_glatting/ObjC/c-runtime/include/RCS/ObjC-proto.h,v 0.12 1992/01/03 02:57:08 dennisg Exp dennisg $
  107.   $Author: dennisg $
  108.   $Date: 1992/01/03 02:57:08 $
  109.   $Log: ObjC-proto.h,v $
  110.  * Revision 0.12  1992/01/03  02:57:08  dennisg
  111.  * modified to handle new initialization scheme.
  112.  * fixed code structure.
  113.  *
  114.  * Revision 0.11  1991/12/10  12:03:22  dennisg
  115.  * Cleaned up file format for a distribution.
  116.  * Added a prototype for archiving.  Now all I have to do is write it.
  117.  *
  118.  * Revision 0.10  1991/12/07  00:57:20  dennisg
  119.  * added objc_classSize() prototype.
  120.  *
  121.  * Revision 0.9  1991/12/06  00:36:24  dennisg
  122.  * added type decls for objc_msgSend*().
  123.  *
  124.  * Revision 0.8  1991/12/01  01:29:29  dennisg
  125.  * modified to remove changes previously made to
  126.  * implement posing.  posing just got easy.
  127.  *
  128.  * Revision 0.7  1991/11/29  22:00:10  dennisg
  129.  * modified to implement set functions.
  130.  *
  131.  * Revision 0.6  1991/11/29  20:02:01  dennisg
  132.  * fixed several const decls.  bozo.
  133.  *
  134.  * Revision 0.5  1991/11/29  13:32:16  dennisg
  135.  * committed some functions to inline and changes prototypes
  136.  * to match.
  137.  * also added some documentation.
  138.  *
  139.  * Revision 0.4  1991/11/29  00:24:14  dennisg
  140.  * many changes including posing, things to make the compiler
  141.  * happier, structure changes, and things to make it play better.
  142.  *
  143.  * Revision 0.3  1991/11/16  16:26:02  dennisg
  144.  * changed some prototypes to make
  145.  * the compiler happier.
  146.  *
  147.  * Revision 0.2  1991/11/07  22:31:42  dennisg
  148.  * added copyleft.
  149.  *
  150.  * Revision 0.1  1991/10/24  00:19:24  dennisg
  151.  * Initial check in.  Preliminary development stage.
  152.  *
  153.  */
  154.  
  155.  
  156. #ifndef _objc_proto_INCLUDE_GNU
  157. #define _objc_proto_INCLUDE_GNU
  158.  
  159. #include  <objc.h>
  160. #include  <objc-protoP.h>
  161.  
  162. #include  <stdlib.h>
  163.  
  164.  
  165. /*
  166.  * Compiler defined prototypes.
  167.  *  These prototypes can't be defined if we're
  168.  *  compiling Objective-C code.
  169.  */
  170. #ifndef __OBJC__
  171. /*
  172.  * objc_getClass() returns the id of the class 
  173.  *  object for the aClassName class.   The class 
  174.  *  object holds information used by instances of 
  175.  *  the class.  
  176.  *
  177.  * Print a message to the standard error stream if 
  178.  *  aClassName isn't part of the executable image.
  179.  */
  180. Class_t 
  181. objc_getClass (const char*);
  182.  
  183. /*
  184.  * objc_getMetaClass() returns the id of the 
  185.  *  meta class object for the aClassName class.  
  186.  *  The meta class object holds information used 
  187.  *  by the class object, just as the class 
  188.  *  object holds information used by instances 
  189.  *  of the class.  
  190.  *
  191.  * Print a message to the standard error stream 
  192.  *  if aClassName isn't part of the executable image.
  193.  */
  194. MetaClass_t 
  195. objc_getMetaClass (const char*);
  196.  
  197. /*
  198.  * The compiler converts every message expression into a 
  199.  *  call on one of these two functions.  Messages to 
  200.  *  super are converted to calls on objc_msgSendSuper(); 
  201.  *  all others are converted to calls on objc_msgSend().
  202.  *
  203.  * These functions return the address of the method 
  204.  *  implementation.  The compiler then generates calls
  205.  *  to those methods passing the full argument array.
  206.  *
  207.  * Calls to objc_msgSend() and objc_msgSendSuper() 
  208.  *  should be generated only by the compiler.  You shouldn't 
  209.  *  call them directly in the Objective-C code you write.
  210.  */
  211. IMP  
  212. objc_msgSend (id, SEL);
  213.  
  214. IMP 
  215. objc_msgSendSuper (Super_t, SEL);
  216. #endif
  217.  
  218. /*
  219.  * Given the name of a variable within a class's 
  220.  *  definition, return a pointer to a structure that
  221.  *  describes it.
  222.  */
  223. Ivar_t  
  224. object_getIvarAddress (id aObject, const char* variableName);
  225.  
  226. /*
  227.  * Given a class and a selector, return a pointer to the method's method
  228.  * structure.  Return NULL if not found. 
  229.  *
  230.  * This is a method internal to the run-time. 
  231.  */
  232. Method_t  
  233. searchForMethodInHierarchy (Class_t, SEL);
  234.  
  235.  
  236. /*
  237.  * class_getInstanceMethod() returns a pointer 
  238.  *  to the data structure that describes the method.  
  239.  *
  240.  * The selector must identify an 
  241.  *  instance method.
  242.  *
  243.  * Return a NULL pointer if aSelector doesn't 
  244.  *  identify a method defined in or inherited 
  245.  *  by aClass.
  246.  */
  247. static inline Method_t  
  248. class_getInstanceMethod (Class_t aClass, SEL aSel) {
  249.  
  250.   return searchForMethodInHierarchy (aClass, aSel);
  251. }
  252.  
  253. /*
  254.  * class_getClassMethod() returns a pointer to 
  255.  *  the data structure that describes the method.  
  256.  *
  257.  * The selector must identify a class (factory) method.  
  258.  *
  259.  * Return a NULL pointer if aSelector doesn't 
  260.  *  identify a method defined in or inherited by aClass.
  261.  */
  262. static inline Method_t  
  263. class_getClassMethod (MetaClass_t aClass, SEL aSel) {
  264.  
  265.   return searchForMethodInHierarchy ((Class_t)aClass, aSel);
  266. }
  267.  
  268. /*
  269.  * This function returns the name of aObject's 
  270.  *  class.  anObject should be an instance 
  271.  *  object, not a class object.
  272.  */
  273. static inline const char* 
  274. object_getClassName (id aObject) {
  275.  
  276.   return aObject->isa->name;
  277. }
  278.  
  279. /*
  280.  * This function returns the name of the 
  281.  *  class. 
  282.  */
  283. static inline const char* 
  284. class_getClassName (Class_t aClassObject) {
  285.  
  286.   return aClassObject->name;
  287. }
  288.  
  289. /*
  290.  * The first function, sel_getUid(), returns a selector that's 
  291.  *  used at run time to identify the aName method.  Whenever 
  292.  *  possible, you should use the @@selector() directive to 
  293.  *  ask the compiler, rather than the run-time system, 
  294.  *  to provide the selector for a method.  This function 
  295.  *  should be used only if the name isn't known at compile 
  296.  *  time.
  297.  *
  298.  * The second function, sel_getName(), is the inverse 
  299.  *  of the first.  It returns the name that was mapped to 
  300.  *  aSelector.
  301.  */
  302. SEL    
  303. sel_getUid (const STR);
  304.  
  305. const STR    
  306. sel_getName (SEL);
  307.  
  308. /*
  309.  * class_addInstanceMethods() adds methods that can be 
  310.  *  used by instances of the class and class_addClassMethods() 
  311.  *  adds methods used by the class object.  Before adding a 
  312.  *  method, both functions check for duplicates.  A warning 
  313.  *  is sent to the standard error stream if any ambiguities exist.
  314.  *
  315.  * The passed structure and its contents must exist for the the
  316.  *  duration of the program.  These functions don't support
  317.  *  linked structures.
  318.  */
  319. static inline void  
  320. class_addInstanceMethods (Class_t aClass, MethodList_t aMethodList) {
  321.  
  322.   addMethodsToClass (aClass, aMethodList);
  323. }
  324.  
  325. static inline void  
  326. class_addClassMethods (Class_t aClass, MethodList_t aMethodList) {
  327.  
  328.   addMethodsToClass ((Class_t)aClass->isa, aMethodList);
  329. }
  330.  
  331. /*
  332.  * This function returns the number of bytes that all of aMethod's
  333.  *  arguments, taken together, would occupy on the stack.
  334.  */
  335. static inline u_int 
  336. method_getSizeOfArguments (Method_t aMethod) {
  337.  
  338.   return atoi (&aMethod->method_types[1]);
  339. }
  340.  
  341. /*
  342.  * This function returns the size in bytes of a 
  343.  *  instance of aObject.
  344.  */
  345. static inline long
  346. objc_classSize (id aObject) {
  347.   
  348.   return aObject->isa->instance_size;
  349. }
  350.  
  351. /* 
  352.  * This function returns the number of arguments that aMethod
  353.  *  the takes.  This will be at least two, since it 
  354.  *  includes the “hidden” arguments, self and _cmd, 
  355.  *  which are the first two arguments passed to every 
  356.  *  method implementation.
  357.  */
  358. u_int 
  359. method_getNumberOfArguments (Method_t aMethod);
  360.  
  361. /* This functiontakes an index into aMethod's argument 
  362.  *  list and returns, by reference, the type of the argument 
  363.  *  and the offset to the location of that argument in the 
  364.  *  list.  Indices begin with 0.  The “hidden” arguments 
  365.  *  self and _cmd are indexed at 0 and 1; method-specific 
  366.  *  arguments begin at index 2.  The offset is measured in 
  367.  *  bytes and depends on the size of arguments preceding the 
  368.  *  indexed argument in the argument list.  The type is 
  369.  *  encoded according to the conventions of the @@encode() 
  370.  *  compiler directive.
  371.  */
  372. u_int 
  373. method_getArgumentInfo (Method_t aMethod, 
  374.                                 int indx, const char **type, int *offset);
  375.  
  376. /*
  377.  * This function is used to support archiving when a unknown class is to read
  378.  *  from a archive.  This function returns a instantiated object.  To further
  379.  *  dearchive the object it should be sent: -readFrom:.
  380.  *
  381.  * This function positions the file pointer just past class Object's class
  382.  *  data.
  383.  */
  384. id  
  385. objc_objectFromFile (int aFd);
  386.  
  387. #endif
  388.  
  389. @
  390.  
  391.  
  392. 0.12
  393. log
  394. @modified to handle new initialization scheme.
  395. fixed code structure.
  396. @
  397. text
  398. @d20 1
  399. a20 1
  400.   $Header: /usr/user/dennis_glatting/ObjC/c-runtime/include/RCS/ObjC-proto.h,v 0.11 1991/12/10 12:03:22 dennisg Exp dennisg $
  401. d22 1
  402. a22 1
  403.   $Date: 1991/12/10 12:03:22 $
  404. d24 4
  405. d73 2
  406. a74 2
  407. #include  <ObjC.h>
  408. #include  <ObjC-proto-private.h>
  409. d94 2
  410. a95 1
  411. Class_t objc_getClass( const char* );
  412. d108 2
  413. a109 1
  414. MetaClass_t objc_getMetaClass( const char* );
  415. d125 5
  416. a129 2
  417. IMP  objc_msgSend (id theReceiver, SEL aSel);
  418. IMP objc_msgSendSuper (Super_t superContext, SEL aSel);
  419. d137 2
  420. a138 1
  421. Ivar_t  object_getIvarAddress( id aObject, const char* variableName );
  422. d141 10
  423. d162 1
  424. a162 1
  425.   class_getInstanceMethod (Class_t aClass, SEL aSel) {
  426. d177 1
  427. a177 1
  428.   class_getClassMethod (MetaClass_t aClass, SEL aSel) {
  429. d188 1
  430. a188 1
  431.   object_getClassName (id aObject) {
  432. d198 1
  433. a198 1
  434.   class_getClassName (Class_t aClassObject) {
  435. d216 2
  436. a217 2
  437. static inline SEL
  438.   sel_getUid (const STR aName) {
  439. d219 2
  440. a220 2
  441.   return (SEL)aName ;
  442. }
  443. a221 6
  444. static inline const STR
  445.   sel_getName (SEL aSelector) {
  446.  
  447.   return (const STR)aSelector ;
  448. }
  449.  
  450. d234 1
  451. a234 1
  452.   class_addInstanceMethods (Class_t aClass, MethodList_t aMethodList) {
  453. d240 1
  454. a240 1
  455.   class_addClassMethods (Class_t aClass, MethodList_t aMethodList) {
  456. d250 1
  457. a250 1
  458.   method_getSizeOfArguments (Method_t aMethod) {
  459. d260 1
  460. a260 1
  461.   objc_classSize (id aObject) {
  462. d272 2
  463. a273 1
  464. u_int method_getNumberOfArguments (Method_t aMethod);
  465. d286 2
  466. a287 1
  467. u_int method_getArgumentInfo (Method_t aMethod, 
  468. d298 2
  469. a299 1
  470. id  objc_objectFromFile (int aFd);
  471. @
  472.  
  473.  
  474. 0.11
  475. log
  476. @Cleaned up file format for a distribution.
  477. Added a prototype for archiving.  Now all I have to do is write it.
  478. @
  479. text
  480. @d20 1
  481. a20 1
  482.   $Header: /usr/user/dennis_glatting/ObjC/c-runtime/include/RCS/ObjC-proto.h,v 0.10 1991/12/07 00:57:20 dennisg Exp dennisg $
  483. d22 1
  484. a22 1
  485.   $Date: 1991/12/07 00:57:20 $
  486. d24 4
  487. d276 2
  488. a277 2
  489.  *    from a archive.  This function returns a instantiated object.  To further
  490.  *    dearchive the object it should be sent: -readFrom:.
  491. d280 1
  492. a280 1
  493.  *    data.
  494. d282 1
  495. a282 1
  496. id    objc_objectFromFile (int aFd);
  497. @
  498.  
  499.  
  500. 0.10
  501. log
  502. @added objc_classSize() prototype.
  503. @
  504. text
  505. @d20 1
  506. a20 1
  507.   $Header: /usr/user/dennis_glatting/ObjC/c-runtime/include/RCS/ObjC-proto.h,v 0.9 1991/12/06 00:36:24 dennisg Exp dennisg $
  508. d22 1
  509. a22 1
  510.   $Date: 1991/12/06 00:36:24 $
  511. d24 3
  512. d66 1
  513. a66 1
  514. #include    <ObjC-proto-private.h>
  515. d68 1
  516. a68 1
  517. #include    <stdlib.h>
  518. d73 2
  519. a74 2
  520.  *    These prototypes can't be defined if we're
  521.  *    compiling Objective-C code.
  522. d86 1
  523. a86 1
  524. Class_t    objc_getClass( const char* );
  525. d99 1
  526. a99 1
  527. MetaClass_t    objc_getMetaClass( const char* );
  528. d103 3
  529. a105 3
  530.  *    call on one of these two functions.  Messages to 
  531.  *    super are converted to calls on objc_msgSendSuper(); 
  532.  *    all others are converted to calls on objc_msgSend().
  533. d108 2
  534. a109 2
  535.  *    implementation.  The compiler then generates calls
  536.  *    to those methods passing the full argument array.
  537. d112 2
  538. a113 2
  539.  *    should be generated only by the compiler.  You shouldn't 
  540.  *    call them directly in the Objective-C code you write.
  541. d124 1
  542. a124 1
  543. Ivar_t    object_getIvarAddress( id aObject, const char* variableName );
  544. d138 1
  545. a138 1
  546.     class_getInstanceMethod (Class_t aClass, SEL aSel) {
  547. d153 1
  548. a153 1
  549.     class_getClassMethod (MetaClass_t aClass, SEL aSel) {
  550. d164 1
  551. a164 1
  552.     object_getClassName (id aObject) {
  553. d174 1
  554. a174 1
  555.     class_getClassName (Class_t aClassObject) {
  556. d181 6
  557. a186 6
  558.  *    used at run time to identify the aName method.  Whenever 
  559.  *    possible, you should use the @@selector() directive to 
  560.  *    ask the compiler, rather than the run-time system, 
  561.  *    to provide the selector for a method.  This function 
  562.  *    should be used only if the name isn't known at compile 
  563.  *    time.
  564. d189 2
  565. a190 2
  566.  *    of the first.  It returns the name that was mapped to 
  567.  *    aSelector.
  568. d193 1
  569. a193 1
  570.     sel_getUid (const STR aName) {
  571. d195 1
  572. a195 1
  573.     return (SEL)aName ;
  574. d199 1
  575. a199 1
  576.     sel_getName (SEL aSelector) {
  577. d201 1
  578. a201 1
  579.     return (const STR)aSelector ;
  580. d206 4
  581. a209 4
  582.  *    used by instances of the class and class_addClassMethods() 
  583.  *    adds methods used by the class object.  Before adding a 
  584.  *    method, both functions check for duplicates.  A warning 
  585.  *    is sent to the standard error stream if any ambiguities exist.
  586. d212 2
  587. a213 2
  588.  *    duration of the program.  These functions don't support
  589.  *    linked structures.
  590. d216 1
  591. a216 1
  592.     class_addInstanceMethods (Class_t aClass, MethodList_t aMethodList) {
  593. d222 1
  594. a222 1
  595.     class_addClassMethods (Class_t aClass, MethodList_t aMethodList) {
  596. d229 1
  597. a229 1
  598.  *    arguments, taken together, would occupy on the stack.
  599. d232 1
  600. a232 1
  601.     method_getSizeOfArguments (Method_t aMethod) {
  602. d234 1
  603. a234 1
  604.     return atoi (&aMethod->method_types[1]);
  605. d239 1
  606. a239 1
  607.  *    instance of aObject.
  608. d242 3
  609. a244 3
  610.     objc_classSize (id aObject) {
  611.     
  612.     return aObject->isa->instance_size;
  613. d249 4
  614. a252 4
  615.  *    the takes.  This will be at least two, since it 
  616.  *    includes the “hidden” arguments, self and _cmd, 
  617.  *    which are the first two arguments passed to every 
  618.  *    method implementation.
  619. d257 9
  620. a265 9
  621.  *    list and returns, by reference, the type of the argument 
  622.  *    and the offset to the location of that argument in the 
  623.  *    list.  Indices begin with 0.  The “hidden” arguments 
  624.  *    self and _cmd are indexed at 0 and 1; method-specific 
  625.  *    arguments begin at index 2.  The offset is measured in 
  626.  *    bytes and depends on the size of arguments preceding the 
  627.  *    indexed argument in the argument list.  The type is 
  628.  *    encoded according to the conventions of the @@encode() 
  629.  *    compiler directive.
  630. d268 1
  631. a268 1
  632.                                                                 int indx, const char **type, int *offset);
  633. d270 9
  634. @
  635.  
  636.  
  637. 0.9
  638. log
  639. @added type decls for objc_msgSend*().
  640. @
  641. text
  642. @d20 1
  643. a20 1
  644.   $Header: /usr/user/dennis_glatting/ObjC/c-runtime/include/RCS/ObjC-proto.h,v 0.8 1991/12/01 01:29:29 dennisg Exp dennisg $
  645. d22 1
  646. a22 1
  647.   $Date: 1991/12/01 01:29:29 $
  648. d24 3
  649. d232 10
  650. @
  651.  
  652.  
  653. 0.8
  654. log
  655. @modified to remove changes previously made to
  656. implement posing.  posing just got easy.
  657. @
  658. text
  659. @d20 1
  660. a20 1
  661.   $Header: /usr/user/dennis_glatting/ObjC/c-runtime/include/RCS/ObjC-proto.h,v 0.7 1991/11/29 22:00:10 dennisg Exp dennisg $
  662. d22 1
  663. a22 1
  664.   $Date: 1991/11/29 22:00:10 $
  665. d24 4
  666. d94 17
  667. @
  668.  
  669.  
  670. 0.7
  671. log
  672. @modified to implement set functions.
  673. @
  674. text
  675. @d20 1
  676. a20 1
  677.   $Header: /usr/user/dennis_glatting/ObjC/c-runtime/include/RCS/ObjC-proto.h,v 0.6 1991/11/29 20:02:01 dennisg Exp dennisg $
  678. d22 1
  679. a22 1
  680.   $Date: 1991/11/29 20:02:01 $
  681. d24 3
  682. d113 1
  683. a113 1
  684.   return searchForMethodInHierarchy (aClass, aSel, NO);
  685. d128 1
  686. a128 1
  687.   return searchForMethodInHierarchy ((Class_t)aClass, aSel, NO);
  688. @
  689.  
  690.  
  691. 0.6
  692. log
  693. @fixed several const decls.  bozo.
  694. @
  695. text
  696. @d20 1
  697. a20 1
  698.   $Header: /usr/user/dennis_glatting/ObjC/c-runtime/include/RCS/ObjC-proto.h,v 0.5 1991/11/29 13:32:16 dennisg Exp dennisg $
  699. d22 1
  700. a22 1
  701.   $Date: 1991/11/29 13:32:16 $
  702. d24 3
  703. d94 1
  704. a94 1
  705. Ivar_t    object_getIvarAddress( id, const STR );
  706. d129 1
  707. a129 1
  708.  * This function returns the name of anObject's 
  709. d134 1
  710. a134 1
  711.     object_getClassName (id anObject) {
  712. d136 1
  713. a136 1
  714.   return anObject->isa->name;
  715. a149 45
  716.  * This function creates a new instance of aClass, 
  717.  *  initializes its isa instance variable to point 
  718.  *  to the class, and return the new instance.  
  719.  *
  720.  *  All other instance variables are initialized to 0.
  721.  */
  722. id    class_createInstance( Class_t, u_int );
  723.  
  724. /*
  725.  * This function destroys a instance of a
  726.  *  class.
  727.  *
  728.  * This function always returns nil.
  729.  */
  730. id    class_destroyInstance( id );
  731.  
  732. /*
  733.  * This function causes one class to pose as its
  734.  *    super class.  Messages sent to the super class will 
  735.  *    actually be sent to the posing class.
  736.  *
  737.  * Instance variables should not be declared in the
  738.  *    posing class.  The posing class can add new methods to
  739.  *    the class or override existing methods in the super class.
  740.  */
  741. Class_t    class_poseAs(Class_t, Class_t);
  742.  
  743. /*
  744.  * These functions set and return the 
  745.  *    class version number.
  746.  */
  747. static inline void 
  748.     class_setVersion(Class_t aClass, long theVersion) {
  749.  
  750.     aClass->version = theVersion ;
  751.     aClass->isa->version = theVersion ;
  752. }
  753.  
  754. static inline long
  755.     class_getVersion(Class_t aClass) {
  756.  
  757.     return aClass->version ;
  758. }
  759.  
  760. /*
  761. d197 4
  762. a200 1
  763.  
  764. d206 24
  765. @
  766.  
  767.  
  768. 0.5
  769. log
  770. @committed some functions to inline and changes prototypes
  771. to match.
  772. also added some documentation.
  773. @
  774. text
  775. @d20 1
  776. a20 1
  777.   $Header: /usr/user/dennis_glatting/ObjC/c-runtime/include/RCS/ObjC-proto.h,v 0.4 1991/11/29 00:24:14 dennisg Exp dennisg $
  778. d22 1
  779. a22 1
  780.   $Date: 1991/11/29 00:24:14 $
  781. d24 5
  782. d52 1
  783. d54 1
  784. d70 1
  785. a70 1
  786. Class_t                objc_getClass( char* const );
  787. d83 1
  788. a83 1
  789. MetaClass_t        objc_getMetaClass( char* const );
  790. d91 1
  791. a91 1
  792. Ivar_t        object_getIvarAddress( id, STR const );
  793. d130 1
  794. a130 1
  795. static inline STR const 
  796. d140 1
  797. a140 1
  798. static inline STR const 
  799. d153 1
  800. a153 1
  801. id            class_createInstance( Class_t, u_int );
  802. d161 1
  803. a161 1
  804. id            class_destroyInstance( id );
  805. d172 1
  806. a172 1
  807. Class_t                class_poseAs(Class_t, Class_t);
  808. d205 1
  809. a205 1
  810.     sel_getUid (STR aName) {
  811. d210 1
  812. a210 1
  813. static inline STR
  814. d213 1
  815. a213 1
  816.     return (STR)aSelector ;
  817. d240 5
  818. @
  819.  
  820.  
  821. 0.4
  822. log
  823. @many changes including posing, things to make the compiler
  824. happier, structure changes, and things to make it play better.
  825. @
  826. text
  827. @d20 1
  828. a20 1
  829.   $Header: /usr/user/dennis_glatting/ObjC/c-runtime/include/RCS/ObjC-proto.h,v 0.3 1991/11/16 16:26:02 dennisg Exp dennisg $
  830. d22 1
  831. a22 1
  832.   $Date: 1991/11/16 16:26:02 $
  833. d24 4
  834. d38 1
  835. a38 1
  836. */
  837. d45 1
  838. a47 1
  839.  
  840. d97 2
  841. a98 1
  842. Method_t      class_getInstanceMethod( Class_t, SEL );
  843. d100 3
  844. d112 2
  845. a113 1
  846. Method_t      class_getClassMethod( MetaClass_t, SEL );
  847. d115 3
  848. d123 2
  849. a124 1
  850. STR const            object_getClassName( id );
  851. d126 3
  852. d133 2
  853. a134 1
  854. STR const            class_getClassName( Class_t );
  855. d136 3
  856. d168 2
  857. a169 2
  858.  * This function (or macro in this case) convers a integer of char*
  859.  *    to a selector.  You should always use this function at run-time.
  860. d171 61
  861. a231 1
  862. #define                cvtToSel(aSel)    ((SEL)(aSel))
  863. @
  864.  
  865.  
  866. 0.3
  867. log
  868. @changed some prototypes to make
  869. the compiler happier.
  870. @
  871. text
  872. @d20 1
  873. a20 1
  874.   $Header: /usr/user/dennis_glatting/ObjC/c-runtime/include/RCS/ObjC-proto.h,v 0.2 1991/11/07 22:31:42 dennisg Exp dennisg $
  875. d22 1
  876. a22 1
  877.   $Date: 1991/11/07 22:31:42 $
  878. d24 4
  879. d135 17
  880. @
  881.  
  882.  
  883. 0.2
  884. log
  885. @added copyleft.
  886. @
  887. text
  888. @d20 1
  889. a20 1
  890.   $Header: /usr/user/dennis_glatting/ObjC/c-runtime/include/RCS/ObjC-proto.h,v 0.1 1991/10/24 00:19:24 dennisg Exp dennisg $
  891. d22 1
  892. a22 1
  893.   $Date: 1991/10/24 00:19:24 $
  894. d24 3
  895. a39 3
  896. id            objc_msgSend( id, SEL, ...);
  897. id            objc_msgSendSuper( Super_t, SEL, ...);
  898.  
  899. d41 3
  900. a43 3
  901.  * Given the name of a variable within a class's 
  902.  *  definition, return a pointer to a structure that
  903.  *  describes it.
  904. d45 1
  905. a45 2
  906. Ivar_t        object_getIvarAddress( id, STR );
  907.  
  908. d55 1
  909. a55 1
  910. Class_t       objc_getClass( const char* );
  911. d68 2
  912. a69 1
  913. MetaClass_t   objc_getMetaClass( const char* );
  914. d72 7
  915. d107 1
  916. a107 1
  917. STR         object_getClassName( id );
  918. d113 1
  919. a113 1
  920. STR         class_getClassName( Class_t );
  921. @
  922.  
  923.  
  924. 0.1
  925. log
  926. @Initial check in.  Preliminary development stage.
  927. @
  928. text
  929. @d5 22
  930. a26 4
  931.   $Header$
  932.   $Author$
  933.   $Date$
  934.   $Log$
  935. @
  936.